package com.retallife.user.controller;


import com.retallife.user.pojo.Goods.GoodsVo;
import com.retallife.user.service.Goods.GoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@Api(tags = "商品信息类")
@RequestMapping(method = {RequestMethod.POST, RequestMethod.GET})
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    @ApiOperation(value = "查询商品表中的所有信息")
    @RequestMapping("FindAllGoods")
    public List<GoodsVo> FindAllGoods() {
        return goodsService.FindAllGoods();
    }

    @ApiOperation(value = "模糊查询某个商品的信息")
    @RequestMapping("FindGoodsByName")
    public List<GoodsVo> FindGoodsByName(@RequestParam String GoodsName) {
        return goodsService.FindGoodsByName(GoodsName);
    }


}
